let testModule = "itmggcloud";


const FileManagerPlugin = require('filemanager-webpack-plugin')

const pages = {
  index: {
    entry: 'src/main.js',
    template: 'public/index.html'
  }
}

module.exports = {
  outputDir: testModule,

  lintOnSave: true,

  pages,

  devServer: {
    open: true,
    host: "localhost",
    https: false,
    hotOnly: false,
    proxy: {
      '/ruifucloud': {    //将www.exaple.com印射为/apis
        target: 'http://www.ruifucloud.com',  // 接口域名
        secure: false,  // 如果是https接口，需要配置这个参数
        ws: true,
        changeOrigin: true,  //是否跨域
        pathRewrite: {
            '^/ruifucloud': ''   //需要rewrite的,
        }              
      }
    }
  },

  filenameHashing: true,

  pluginOptions: {

  },
  configureWebpack: {  //webpack的相关配置在这里
    plugins: [
        new FileManagerPlugin({  //初始化 filemanager-webpack-plugin 插件实例
            onEnd: {
                delete: [   //首先需要删除项目根目录下的dist.zip
                    './itmggcloud.zip',
                ],
                archive: [ //然后我们选择dist文件夹将之打包成dist.zip并放在根目录
                    {source: './itmggcloud', destination: './itmggcloud.zip'},
                ]
            }
        })
    ]
  } 
}